package com.shuda.db.user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shuda.db.user.dao.RoleDao;
import com.shuda.db.user.entity.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleDbService {
    
    @Autowired
    private RoleDao roleDao;
    
    public Role getById(Long id) {
        return roleDao.getById(id);
    }
    
    public Role getByRoleCode(String roleCode) {
        return roleDao.getByRoleCode(roleCode);
    }
    
    public List<Role> getList(Page<Role> page) {
        return roleDao.getList(page);
    }
    
    public int insert(Role role) {
        return roleDao.insert(role);
    }
    
    public int update(Role role) {
        return roleDao.update(role);
    }
    
    public int delete(Long id) {
        return roleDao.delete(id);
    }
}